#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "goset.h"
#include "fun.h"
#include  "com.h"
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

signals:

    void send_bush();
private slots:
    void on_test_sql_clicked();    

    void on_test_id_clicked();

    void on_test_set_clicked();

    void on_test_exit_clicked();

    void run_time_out();
    void bush_time_out();

    void on_start_clicked();

    void on_test_cal_clicked();

    void on_test_sum_clicked();

    void on_test_save_clicked();

    void on_reset_clicked();

    void on_comboBox_currentIndexChanged(int index);

    void on_ctrl_clicked();

private:
    Ui::MainWindow *ui;
    void test_load();//

    int add=35;
    goset *go_logo[10];

    test buffer;
    com *con_com;
    QTimer *run_time;
    QTimer *bush_time;

    int state_id=0;//状态机序列
    int time_add=0;
    int time_stop=0;

    int time_fire=0;

    double Lerp(double x0,double x1,double y0,double y1,double x);
    void  get_bush();

    int water_loop_test_state=0;

    void send_sata(int ID,bool ON);

    int water_time=0;
    double refrigeration=0;

    void test_new();
};

#endif // MAINWINDOW_H
